#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    :  
# @function: 
# @version :


# 爬虫包
import requests  # 第三方包


# 创建一个爬虫函数 获取图片
def get_image(url):
    response = requests.get(url).content

    # 拿到网站数据之后需要保存到本地
    file_name = url.rsplit('/')[-1]
    save_path = "pic/" + file_name
    with open(save_path, 'wb') as f:
        f.write(response)
        print('下载完成...')


# 定义网站数据请求地址
url_list = [
        'http://pic.bizhi360.com/bbpic/98/10798.jpg',
        'http://pic.bizhi360.com/bbpic/92/10792.jpg',
        'http://pic.bizhi360.com/bbpic/86/10386.jpg'
]

for url in url_list:
    get_image(url)
